from django.shortcuts import render

# Create your views here.
from rest_framework.viewsets import ReadOnlyModelViewSet

from activity.models import Activity
from activity.serializers import ActivitiesSerializer, ActivitySerializer


class ActivityViewSet(ReadOnlyModelViewSet):
    queryset = Activity.objects.all().order_by('-start_time')

    def get_serializer_class(self):
        if self.action == 'list':
            return ActivitiesSerializer
        else:
            return ActivitySerializer


